﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using VisualAgile.Model;

namespace VisualAgile.Web.Tests
{
    class FakeTaskData
    {
        public static List<Task> CreateTestTasks()
        {
            List<Task> tasks = new List<Task>() { 
                ToDoTask(),
                InProgressTask(),
                OnTestTask(),
                DoneTask()
            };

            for (int i = 0; i < 10; i++)
            {
                Task sampleTask = new Task()
                {
                   TaskID = Guid.NewGuid(),
                   IterationID = "2EBDBC36-3585-47b3-8709-BE3184956938",
                   Name = "New Task",
                   Primary = true,                   
                   CreateDate = DateTime.Now,
                   Evaluation = 10.0,                   
                   CreateTime = DateTime.Now                   
                };                

                tasks.Add(sampleTask);
            }

            return tasks;
        }
        
        public static Task ToDoTask()
        {                        
            Task todo = new Task()
            {
                TaskID = new Guid("29DC7A46-52B5-4941-AAE2-F48592847E42"),
                IterationID = "29DC7A46-52B5-4941-AAE2-F48592847E42",
                Name = "todo task",
                Primary = true,
                CreateDate = DateTime.Now,
                Evaluation = 10.0,         
                Remaining = 10.0,
                Beyond = 0.0,                
                CreateTime = DateTime.Now                
            };
            
            todo.AddActual(FakeActualData.CreateTestActual()[0]);
            todo.Story = FakeStoryData.DemoStory();                 

            return todo;
        }

        public static Task InProgressTask()
        {
            Task inProgress = new Task()
            {
                TaskID = new Guid("BE4B0656-8685-439e-B4EA-66D5C9BA7508"),
                IterationID = "BE4B0656-8685-439e-B4EA-66D5C9BA7508",
                Name = "inprogress Task",
                Primary = true,
                CreateDate = DateTime.Now,
                Evaluation = 10.0,         
                CreateTime = DateTime.Now
            };

            inProgress.AddActual(FakeActualData.CreateTestActual()[0]);
            inProgress.Story = FakeStoryData.DemoStory();           

            return inProgress;
        }

        public static Task DoneTask()
        {
            Task Done = new Task()
            {
                TaskID = new Guid("860746BC-810F-43bb-A5C5-87B12A6FC6DC"),
                IterationID = "BE4B0656-8685-439e-B4EA-66D5C9BA7508",
                Name = "Done Task",
                Primary = true,
                CreateDate = DateTime.Now,
                Evaluation = 10.0,
                CreateTime = DateTime.Now
            };

            Done.AddActual(FakeActualData.CreateTestActual()[0]);
            Done.Story = FakeStoryData.DefaultStory();
            
            return Done;
        }

        public static Task OnTestTask()
        {
            Task OnTest = new Task()
            {
                TaskID = new Guid("126D4D30-3AD9-48ef-A62D-E7710584E10B"),
                IterationID = "BE4B0656-8685-439e-B4EA-66D5C9BA7508",
                Name = "on test Task",
                Primary = true,
                CreateDate = DateTime.Now,
                Evaluation = 10.0,
                CreateTime = DateTime.Now
            };

            OnTest.AddActual(FakeActualData.CreateTestActual()[0]);
            OnTest.Story = FakeStoryData.DefaultStory();           

            return OnTest;
        }      
    }
}
